package com.ats.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ats.service.GetNoApprovalsService_ty;
import com.ats.serviceimpl.GetNoApprovalServiceImpl;
/**
 * 
 * @author TangRain
 *
 */
public class SetLeaveController_ty extends HttpServlet{
	GetNoApprovalsService_ty  gasi=new GetNoApprovalServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		resp.setCharacterEncoding("utf8");
		int lid=Integer.parseInt(req.getParameter("lid"));
		String noreson=req.getParameter("noreson");
		if(noreson==null){
			gasi.setNoApproval(lid);
		}else{
		gasi.setNoReson(lid, noreson);
		}
	}

}
